###############################################################################
#
# Copyright (c) 2000 Palm Computing, Inc. or its subsidiaries.
# All rights reserved.
#
# File: Makefile
#
###############################################################################

TARGET = ResistorDA
APPNAME = ResistorDA
APPID = DARs
DBTYPE = DAcc

OBJS = $(TARGET).o
LIBS = 

CC = m68k-palmos-gcc
CFLAGS = -O2 -Wall -v
CSFLAGS = $(CFLAGS) -S
PILRC = pilrc
BUILDPRC = build-prc
OBJRES = obj-res


all: ../$(TARGET).prc

# $(TARGET).o: $(TARGET).c $(TARGET).h $(TARGET)_res.h

.c.s:
	$(CC) $(CSFLAGS) $<

.c.o:
	$(CC) $(CFLAGS) -c $<

$(TARGET): $(OBJS)
	$(CC) $(CFLAGS) -nostartfiles $(OBJS) -o $(TARGET) $(LIBS)

code03e8.grc: $(TARGET)
	$(OBJRES) $(TARGET)
	mv code0001.$(TARGET).grc $@
	rm *.$(TARGET).grc

../$(TARGET).prc: $(TARGET).rcp $(TARGET)_res.h code03e8.grc 
	$(PILRC) -q $(TARGET).rcp
	$(BUILDPRC) -t $(DBTYPE) ../$(TARGET).prc $(APPNAME) $(APPID) code03e8.grc *.bin

clean:
	rm -f $(TARGET) *.o *.bin

install:
	pilot-xfer -i ../$(TARGET).prc

tar:
	tar c -zf $(TARGET)_src.tar.gz Makefile *.h *.pnm *.c *.rcp 

